package com.cs.dao;

import com.cs.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    List<Student> selectAll();
    @Select("select * from student where studentId = #{id}")
    Student SelectById(int id);
    @Select("select * from student where studentName like '%${studentName}%'")
    List<Student> selectName(String studentName);
    @Delete("delete from student where studentId = #{id}")
    int deleteById(int id);
    @Insert("insert into student (studentName,classname,classTeacher) values (#{studentName},#{classname},#{classTeacher})")
    int insertStudent(Student student);
    @Update("update student set studentName = #{studentName},classname = #{classname},classTeacher = #{classTeacher} where studentId = #{studentId}")
    int updateStudent(Student student);
}
